import request from '@/config/axios'

// 客服咨询记录 VO
export interface ServiceRecordVO {
  recordId: number // 记录ID（主键）
  userId: number // 用户ID（外键）
  question: string // 咨询内容
  reply: string // 回复内容
  serviceType: number // 服务类型
  createTime1: Date // 咨询时间
}

// 客服咨询记录 API
export const ServiceRecordApi = {
  // 查询客服咨询记录分页
  getServiceRecordPage: async (params: any) => {
    return await request.get({ url: `/customer/service-record/page`, params })
  },

  // 查询客服咨询记录详情
  getServiceRecord: async (id: number) => {
    return await request.get({ url: `/customer/service-record/get?id=` + id })
  },

  // 新增客服咨询记录
  createServiceRecord: async (data: ServiceRecordVO) => {
    return await request.post({ url: `/customer/service-record/create`, data })
  },

  // 修改客服咨询记录
  updateServiceRecord: async (data: ServiceRecordVO) => {
    return await request.put({ url: `/customer/service-record/update`, data })
  },

  // 删除客服咨询记录
  deleteServiceRecord: async (id: number) => {
    return await request.delete({ url: `/customer/service-record/delete?id=` + id })
  },

  // 导出客服咨询记录 Excel
  exportServiceRecord: async (params) => {
    return await request.download({ url: `/customer/service-record/export-excel`, params })
  }
}